package com.ssh.core;

import java.util.List;

public class QueryResult<T> {
	public int getNext() {
		return this.pageNo*this.pageSize>=this.recordCount?0:this.pageNo+1;
	}

	public void setNext(int next) {
		this.next = next;
	}

	public int getPrevious() {
		return this.pageNo>0?this.pageNo-1:1;
	}

	public void setPrevious(int previous) {
		this.previous = previous;
	}

	private int next,previous;
	
	public int getPageNo() {
		return pageNo;
	}
	public int getPageSize() {
		return pageSize;
	}
	public int getRecordCount() {
		return recordCount;
	}
	private int pageNo;
	private int totalPage;
	private int pageSize;
	private int recordCount;
	private List<T> list;
	public  QueryResult<T> setPageNo(int pageNo) {
		this.pageNo=pageNo;
		return this;
	}
	public  QueryResult<T> setPageSize(int pageSize) {
		this.pageSize=pageSize;
		return this;
	}
	public QueryResult<T> setRecordCount(int count) {
		this.recordCount=count;
		return this;
	}
	public void setRecords(List list) {
		this.setList(list);
	}
	public List<T> getList() {
		return list;
	}
	public void setList(List<T> list) {
		this.list = list;
	}

	public int getTotalPage() {
		return recordCount/pageSize+1;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage ;
	}
}
